﻿using System;
using Microsoft.VisualStudio.Debugger.Interop;
using Red.Scripts.Debugger.Defines;

namespace Red.Scripts.Debugger.Remote.Debugger.Breakpoint.Resolution
{
    public class StandardCodeContext : IDebugMemoryContext2, IDebugCodeContext2, IDebugCodeContext100
    {
        #region Public Properties

        public StandardDocumentContext DocumentContext { get; private set; }
        public IDebugProgram2 Program { get; private set; }

        #endregion Public Properties

        #region C-Tor

        public StandardCodeContext( StandardDocumentContext documentContext, IDebugProgram2 program )
        {
            DocumentContext = documentContext;
            Program = program;
        }

        #endregion C-Tor

        #region IDebugCodeContext2

        public int GetDocumentContext( out IDebugDocumentContext2 ppSrcCxt )
        {
            ppSrcCxt = DocumentContext;

            return Constants.S_OK;
        }

        public int GetLanguageInfo( ref string pbstrLanguage, ref Guid pguidLanguage )
        {
            return DocumentContext.GetLanguageInfo( ref pbstrLanguage, ref pguidLanguage );
        }

        #endregion IDebugCodeContext2

        #region IDebugCodeContext100

        public int GetProgram( out IDebugProgram2 ppProgram )
        {
            ppProgram = Program;

            return Constants.S_OK;
        }

        #endregion IDebugCodeContext100

        #region IDebugMemoryContext2

        public int Add( ulong dwCount, out IDebugMemoryContext2 ppMemCxt )
        {
            throw new NotImplementedException();
        }

        public int Compare( enum_CONTEXT_COMPARE Compare, IDebugMemoryContext2[] rgpMemoryContextSet, uint dwMemoryContextSetLen, out uint pdwMemoryContext )
        {
            throw new NotImplementedException();
        }

        public int GetInfo( enum_CONTEXT_INFO_FIELDS dwFields, CONTEXT_INFO[] pinfo )
        {
            pinfo[ 0 ].dwFields = 0;

            return Constants.S_OK;
        }

        public int GetName( out string pbstrName )
        {
            throw new NotImplementedException();
        }

        public int Subtract( ulong dwCount, out IDebugMemoryContext2 ppMemCxt )
        {
            throw new NotImplementedException();
        }

        #endregion IDebugMemoryContext2
    }
}
